<template>
  <el-dialog
    v-model="subTableSubmitFormDialogVisible"
    :width="subTableProp.submitFormDialog.width"
    :title="subTableProp.submitFormDialog.title"
    :close-on-click-modal="false"
  >
    <slot name="subTableSubmitFormSlot"></slot>
    <template #footer>
      <el-button
        style="float: left"
        type="primary"
        @click="
          changeSubTableSubmitFormDialogVisible();
          subTableFormSubmit();
        "
        >确认</el-button
      >
      <el-button @click="changeSubTableSubmitFormDialogVisible()"
        >取消</el-button
      >
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { inject } from "vue";

/**
 * 传递属性供dialog使用.
 */
const subTableProp = inject("subTableProp");

const subTableSubmitFormDialogVisible = inject(
  "subTableSubmitFormDialogVisible"
);

const changeSubTableSubmitFormDialogVisible = inject(
  "changeSubTableSubmitFormDialogVisible"
);

const subTableFormSubmit = inject("subTableFormSubmit") as () => void;
</script>

<style scoped></style>
